<?php
class Application_Model_Info
{
	protected $_username;
	protected $_status;
	protected $_contact;
	protected $_createDt;
	protected $_modifyDt;
	protected $_id;
	
	public function __construct(array $options = null)
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid blog property');
		}
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid blog property');
		}
		return $this->$method();
	}

	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	
	public function setUsername($text)
	{
		$this->_username = (string) $text;
		return $this;
	}
	
	public function getUsername()
	{	
		return $this->_username;
	}
	
	public function setStatus($status)
	{
		$this->_status = (string) $status;
		return $this;
	}
	
	public function getStatus()
	{
		return $this->_status;
	}
	
	public function setContact($contact)
	{
		$this->_contact = (string) $contact;
		return $this;
	}
	
	public function getContact()
	{
		return $this->_contact;
	}
	
	public function setCreateDt($ts)
	{
		$this->_createDt = $ts;
		return $this;
	}

	public function getCreateDt()
	{
		return $this->_createDt;
	}

	public function setModifyDt($ts)
	{
		$this->_modifyDt = $ts;
		return $this;
	}

	public function getModifyDt()
	{
		return $this->_modifyDt;
	}

	public function setId($id)
	{
		$this->_id = (int) $id;
		return $this;
	}

	public function getId()
	{
		return $this->_id;
	}
}

